package com.boot.controller;

import com.boot.entity.Game;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.Arrays;
import java.util.List;

@RestController
@CrossOrigin(origins = "*")
public class DataController {

    @GetMapping("/page")
    public List<Game> page(@RequestParam(name = "page",defaultValue = "1") Integer page){
        List<Game> games = Arrays.asList(
                new Game("胸口碎大石","创意游戏","http://localhost:8080/images/photo.png","动手画个圆，你行吗？"),
                new Game("胸口碎大石","创意游戏","http://localhost:8080/images/photo.png","动手画个圆，你行吗？"),
                new Game("胸口碎大石","创意游戏","http://localhost:8080/images/photo.png","动手画个圆，你行吗？"),
                new Game("胸口碎大石","创意游戏","http://localhost:8080/images/photo.png","动手画个圆，你行吗？"),
                new Game("胸口碎大石","创意游戏","http://localhost:8080/images/photo.png","动手画个圆，你行吗？"),
                new Game("胸口碎大石","创意游戏","http://localhost:8080/images/photo.png","动手画个圆，你行吗？"),
                new Game("胸口碎大石","创意游戏","http://localhost:8080/images/photo.png","动手画个圆，你行吗？"),
                new Game("胸口碎大石","创意游戏","http://localhost:8080/images/photo.png","动手画个圆，你行吗？"),
                new Game("胸口碎大石","创意游戏","http://localhost:8080/images/photo.png","动手画个圆，你行吗？"),
                new Game("胸口碎大石","创意游戏","http://localhost:8080/images/photo.png","动手画个圆，你行吗？")
        );

        return games;
    }

}
